package com.indigon.parkStory.view.objects.ui
{
	import com.indigon.parkStory.model.objects.ScoreModel;
	import com.indigon.parkStory.view.objects.ObjectView;
	
	import flash.display.DisplayObjectContainer;

	public class ScoreView extends ObjectView
	{
		public static const ID : String = "score";
		
		private static const GOAL_ID  : String = "txt_goal";
		private static const TIME_ID  : String = "txt_time";
		private static const SCORE_ID : String = "txt_score";
		private static const COMBO_ID : String = "txt_combo";
		
		public function ScoreView(score:ScoreModel)
		{
			super(new GFX_ScoreUI(), score);
		}
		
		public override function set(container:DisplayObjectContainer, x:Number, y:Number, rotation:Number=0, layer:uint=0):void
		{
			update();
			updateStats();
			super.set(container, x, y, rotation, layer);
		}
		
		public override function update():void
		{
		
		}
		
		public function updateStats():void
		{
			var score : ScoreModel = ScoreModel(_object);
			graphic[SCORE_ID].text = score.score;
			graphic[COMBO_ID].text = "x" + score.combo;
		}
	}
}
